// @ts-ignore
/* eslint-disable */
import request from '@/request'

/** addSpace POST /api/space/add */
export async function addSpaceUsingPost(body: API.SpaceAddReq, options?: { [key: string]: any }) {
  return request<API.BaseResponseString_>('/api/space/add', {
    method: 'POST',
    headers: {
      'Content-Type': 'application/json',
    },
    data: body,
    ...(options || {}),
  })
}

/** updateSpaceByAdmin POST /api/space/admin/update */
export async function updateSpaceByAdminUsingPost(
  body: API.SpaceUpdateReq,
  options?: { [key: string]: any }
) {
  return request<API.BaseResponseVoid_>('/api/space/admin/update', {
    method: 'POST',
    headers: {
      'Content-Type': 'application/json',
    },
    data: body,
    ...(options || {}),
  })
}

/** getCurrentUserSpace GET /api/space/current/space */
export async function getCurrentUserSpaceUsingGet(options?: { [key: string]: any }) {
  return request<API.BaseResponseSpaceVO_>('/api/space/current/space', {
    method: 'GET',
    ...(options || {}),
  })
}

/** deleteSpace POST /api/space/delete */
export async function deleteSpaceUsingPost(body: API.IdRequest, options?: { [key: string]: any }) {
  return request<API.BaseResponseVoid_>('/api/space/delete', {
    method: 'POST',
    headers: {
      'Content-Type': 'application/json',
    },
    data: body,
    ...(options || {}),
  })
}

/** editSpace POST /api/space/edit */
export async function editSpaceUsingPost(body: API.SpaceEditReq, options?: { [key: string]: any }) {
  return request<API.BaseResponseVoid_>('/api/space/edit', {
    method: 'POST',
    headers: {
      'Content-Type': 'application/json',
    },
    data: body,
    ...(options || {}),
  })
}

/** listSpacePage GET /api/space/list */
export async function listSpacePageUsingGet(
  // 叠加生成的Param类型 (非body参数swagger默认没有生成对象)
  params: API.listSpacePageUsingGETParams,
  options?: { [key: string]: any }
) {
  return request<API.BaseResponsePageSpaceVO_>('/api/space/list', {
    method: 'GET',
    params: {
      ...params,
    },
    ...(options || {}),
  })
}

/** listSpaceLevel GET /api/space/spaceLevel */
export async function listSpaceLevelUsingGet(options?: { [key: string]: any }) {
  return request<API.BaseResponseListSpaceLevel_>('/api/space/spaceLevel', {
    method: 'GET',
    ...(options || {}),
  })
}

/** getSpaceVOById GET /api/space/vo/${param0} */
export async function getSpaceVoByIdUsingGet(
  // 叠加生成的Param类型 (非body参数swagger默认没有生成对象)
  params: API.getSpaceVOByIdUsingGETParams,
  options?: { [key: string]: any }
) {
  const { id: param0, ...queryParams } = params
  return request<API.BaseResponseSpaceVO_>(`/api/space/vo/${param0}`, {
    method: 'GET',
    params: { ...queryParams },
    ...(options || {}),
  })
}
